1. Field of the Invention
The present invention relates to a method and an apparatus for three-dimensional measurement and an image processing device, for calculating three-dimensional data of an object from taken images.
2. Description Related to the Prior Art
A three-dimensional measurement apparatus that calculates three-dimensional data (for example, dimensions) of an object based on two images of the object taken from two different image capture positions is known. The three-dimensional measurement apparatus is composed of, for example, two cameras, a processing device, and the like. The two cameras are disposed with a predetermined space (hereinafter referred to as the baseline length) from each other in a left-right direction. The processing device calculates the three-dimensional data based on the images, with parallax, taken with the two cameras.
For the three-dimensional measurement, the two images need to have parallax and contain the same object. For example, images taken with a stereo camera having two taking lenses may be used. Accuracy in measuring the three-dimensional data with the three-dimensional measurement apparatus depends on a relationship between the scale of the object and the baseline length. In a case where the scale of the object is large relative to the baseline length of the stereo camera, the obtained three-dimensional data may be unreliable due to a large error. For this reason, a long baseline length is necessary for measuring the three-dimensional data of an object with the relatively large scale (e.g. a building) with high accuracy. For example, a three-dimensional measurement apparatus disclosed in Japanese Patent Laid-Open Publication No. 2007-263669 constitutes a huge stereo camera as a whole with the use of two cameras mounted on a car.
It is necessary to measure or specify the baseline length accurately to perform the three-dimensional measurement with high accuracy. Normally, the stereo camera is precisely calibrated in advance at the time of manufacture, to achieve the predetermined baseline length. However, it is difficult to measure the baseline length accurately or to adjust the baseline length accurately to the predetermined value in the case where the two cameras are used to constitute the huge stereo camera as described in the Japanese Patent Laid-Open Publication No. 2007-263669. For this reason, the Japanese Patent Laid-Open Publication Nos. 2007-263669 and 2005-241323 disclose calibration methods for accurately measuring the baseline length in advance.
Recently, a three-dimensional measurement apparatus which measures the three-dimensional data with high accuracy with a stereo camera having a short baseline length has been known. The three-dimensional data is measured based on the images of the object taken from two image capture positions. However, a three-dimensional measurement apparatus disclosed in U.S. Patent Application Publication No. 2011/0249117 (corresponding to Japanese Patent Laid-Open Publication No. 2011-232330) needs to take an image of a reference object having known shape and dimensions together with the object whose three-dimensional data is to be measured, to obtain the distance between the two image capture positions. Suppose the stereo camera at the first image capture position and the stereo camera at the second image capture position constitute a huge stereo camera as a whole, the distance between the two image capture positions corresponds to the baseline length of the huge stereo camera. This three-dimensional measurement apparatus is similar to those disclosed in the Japanese Patent Laid-Open Publication Nos. 2007-263669 and 2005-241323 in that the baseline length needs to be a known value.
In the case where the two cameras are used to constitute the huge stereo camera having a long baseline length (distance between the two cameras) to perform the three-dimensional measurement, the baseline length needs to be measured or calibrated with high accuracy in advance as disclosed in the Japanese Patent Laid-Open Publication Nos. 2007-263669 and 2005-241323. If the positions of the cameras are moved to place the object properly in the imaging fields, complicated recalibration is necessary. For example, in a case where the two cameras are mounted on a car as disclosed in the Japanese Patent Laid-Open Publication No. 2007-263669, the direction of the car needs to be changed to image the object properly with the two cameras. In addition, the positions of the cameras need to be changed in case of a narrow road or no-entry street.
Carrying the huge stereo camera with the long baseline length without it being mounted on the car is not practical because the stereo camera is too huge. In the case where the two cameras are carried separately, it is nearly impossible to rearrange them at the distance of the predetermined baseline length from each other without calibration. Thus, the huge stereo camera with the long baseline length is inconvenient because re-calibration is required in many circumstances.
In the case where the normal-sized stereo camera with the short baseline length is used to perform the three-dimensional measurement, it is possible to carry the reference object and place the reference object at an appropriate position to take an image of the object as described in the U. S. Patent Application Publication No. 2011/0249117, but it is inconvenient. For example, the reference object needs to be placed not to interfere with the three-dimensional measurement of the object. The three-dimensional measurement may not be performed in a case where the reference object cannot be placed properly with the object in the imaging field, for example, when the dimensions of the object situated at an elevated position are necessary. In addition, it is difficult to select the shape and the material of the reference object which enables the calculation of the baseline length of the huge stereo camera with high accuracy irrespective of the imaging circumstances.
Thus, the conventional apparatus requires the calibration that makes the operations complicated. The three-dimensional measurement cannot be performed with high accuracy without the calibration and the accurate measurement of the baseline length.